package org.c797797ty.railway.model;

/**
 * @author C797797ty
 * @data 2025/11/3 14:25
 */
public class User {
    private int id;
    private String username;
    private String password;
    private boolean isLoggedIn;
    private String role; // 新增角色字段，"user"或"admin"

    public User(int id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.isLoggedIn = false;
        this.role = "user"; // 默认角色为普通用户
    }

    public User(int id, String username, String password, String role) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.isLoggedIn = false;
        this.role = role;
    }


    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getUsername() { return username; }
    public String getPassword() { return password; }
    public boolean isLoggedIn() { return isLoggedIn; }
    public void setLoggedIn(boolean loggedIn) { isLoggedIn = loggedIn; }
    public String getRole() { return role; }
    public void setRole(String role) { this.role = role; }
}